package com.itheima.utils;

import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import org.apache.ibatis.reflection.MetaObject;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;

/**
 * @Description: 在所有的新增和修改里面都要设置默认的数据，使得代码冗余，所以共享添加
 * @Create by: JJ菜菜
 * @Date: 2021/11/1 21:11
 */

@Component
public class MyMetaObjectHandler implements MetaObjectHandler {

    @Override
    public void insertFill(MetaObject metaObject) {
      /*  employee.setCreateUser(1L);
        employee.setUpdateUser(1L);
        employee.setCreateTime(LocalDateTime.now());
        employee.setUpdateTime(LocalDateTime.now());
            metaObject.setValue("user");*/
    }

    @Override
    public void updateFill(MetaObject metaObject) {

    }
}
